home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / tchk21ex.zip / DEMOPARS.C < prev    next >
C/C++ Source or Header  |  1989-06-06  |  1KB  |  45 lines

  1. /* TCHK 2.1 - Howard Kapustein's Turbo C library        6-6-89      */
  2. /* Copyright (C) 1988,1989 Howard Kapustein.  All rights reserved.  */
  3.  
  4. /* demopars.c  -  used for testing TCHK parsing functions */
  5.  
  6. #include <howard.h>
  7. #include <video.h>
  8. #include <color.h>
  9. #include <filehk.h>
  10. #include <keycode.h>
  11. #include <keyboard.h>
  12. #include <string.h>
  13. #include <stringhk.h>
  14. #include <alloc.h>
  15.  
  16. void main();
  17.  
  18. void main()
  19. {
  20.     struct filespec *fs;
  21.     char temp[80], temp2[80];
  22.     int k, argk[] = { ESC };
  23.  
  24.     do {
  25.         cls();
  26.         textattr(LCYAN);
  27.         cputs("Input a filespec (ESC to end):");
  28.         textattr(LRED);
  29.         strfill(temp,' ',59);
  30.         k = getget(32,1,temp,60,"X",1,argk,TRIMALL|INSERTMODE);
  31.         if (k == ESC)
  32.             break;
  33.         fs = parsefilename(temp);
  34.         gotoxy(1,2);
  35.         textattr(YELLOW);
  36.         cprintf("Parsed -> %c    [%s]    [%s]\r\n",fs->drive,fs->path,fs->filename);
  37.         expandfilespec(temp,temp2);
  38.         cprintf("Expanded -> [%s]\r\n",temp2);
  39.         textattr(LRED);
  40.         cputs("Press any key to continue");
  41.         inkey(TRUE);
  42.         free(fs);
  43.     } while (TRUE);
  44. }
  45.